#include <stdio.h>
void FindMax(const int* p, int len, int* pmax, int* pmin)
{
	if (pmax)
	{
		*pmax = *p;
		for (int i = 1;i < len;i++)
		{
			if (*(p + i) > * pmax)
				*pmax = *(p + i);
		}
	}
	if (pmin)
	{
		*pmin = *p;
		for (int i = 1;i < len;i++)
		{
			if (*(p + i) < *pmin)
				*pmin = *(p + i);
		}
	}
}
int main()
{
	int arr[5] = { 1,23,33,45,6 };
	int min = 0;
	int max = 0;
	FindMax(arr, 5, &max, 0);
	printf("min is:%d\n max is:%d", min, max);
}